Skip to content

Conversation

@pingsutw
Copy link
Member

@pingsutw pingsutw commented Jul 7, 2025

Tracking issue

NA

Why are the changes needed?

Fails to register the map task with partial inputs because the _bound_inputs are not in order. If the order changes, Admin receives a different TaskTemplate and raises an error at registration time.

What changes were proposed in this pull request?

sort _bound_inputs

How was this patch tested?

import functools

from union import workflow, task, ImageSpec, map

image = ImageSpec(
    builder="union",
    packages=["union==0.1.182"],
)


@task(container_image=image)
def my_task(a: int, b: int, c: int, d: int, e: int) -> int:
    print("adding one...")
    return 2


@workflow
def wf():
    vals = [1,2,3,4,5]
    # t1 = functools.partial(my_task, b=1, c=1)
    # _ = map(t1, bound_inputs={"b", "c"})(a=vals)
    _ = map(my_task, bound_inputs={"b": 1, "c": 1, "d": 1, "e": 1})(a=vals)

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

This pull request improves the workflow model by sorting bound inputs, addressing issues with unsorted inputs that could cause registration errors for map tasks. This enhancement increases the reliability of task registration.

Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw merged commit 4c889d6 into master Jul 7, 2025
114 of 115 checks passed
@madiyar-wayve
Copy link

Hi, just wanted to let you know that this change breaks when self._bound_inputs = None.

@pingsutw
Copy link
Member Author

@madiyar-wayve good catch. I'll create a PR today, thanks for reporting it

Atharva1723 pushed a commit to Atharva1723/flytekit that referenced this pull request Oct 5, 2025
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Atharva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants